Path: api/v1/pos/{pono}/stock
This API is JSON:API compliant.
This endpoint supports the following methods:
GET POST PATCH DELETE
This endpoint requires an OAuth bearer token, and returns errors in a standard shape. See API Conventions for authentication, error responses and paging, which apply to every endpoint.
The resource type for this endpoint is PurchaseStock
The identifier is pono-lineid
Attributes
The PurchaseStock resource type attributes are as follows:
| Attribute | Type | Read-only | Description |
|---|---|---|---|
| adddate | string (DateTime in ISO format) | ✓ | The date and time the stock line was added. |
| addinit | string | ✓ | The initials of the user who added the stock line. |
| configNo | integer | ✓ | Stock attribute configuration number. Note: Will not be returned in the response if value is null. |
| description | string | The stock description. Only required if the default stock description needs to be overrridden. It is recommended this be set for special stock. | |
| modifydate | string (DateTime in ISO format) | ✓ | The date and time the stock line was last modified. |
| modifyinit | string | ✓ | The initials of the user who last modified the stock line. |
| qty | number | The quantity ordered. Updating the quantity ordered has no impact on quantity received. | |
| qtyReceived | number | The quantity to be received. Updating the quantity received has no impact on quantity ordered. | |
| serials | array of object | The serial numbers allocated to this PO line, each with its stock attributes. See the serials section below. |
|
| stockAttrs | array of object | The stock attributes (name/value pairs) configured for this PO line. See the stockAttrs section below. |
|
| stockCode | string | ✓ | The Jim2 stock code |
| stockId | integer | ✓ | The Jim2 stock number of the line's stock item. |
| unit | string | ✓ | The unit of measure for the stock line. |
| unitPrice | number | The unit price. If PO is calculating prices from tax paid amounts this will be tax inclusive, otherwise this will be tax exclusive. It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins. |
|
| unitPriceTF | number | The unit price exlusive of tax. Note that if PO is calculating prices from tax paid amounts the actual price set may differ due to rounding. It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins. |
|
| unitPriceTP | number | The unit price inclusive of tax. Note that if PO is calculating prices from tax exclusive amounts the actual price set may differ due to rounding. It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins. |
Attributes of each element in the serials array.
| Attribute | Type | Read-only | Description |
|---|---|---|---|
| serialNo | string | A stock serial number. | |
| stockAttrs | array of object | Only applicable to stock that is serial and attributed on purchase or serial on sell. See the serials.stockAttrs section below. |
Attributes of each element in the stockAttrs array.
| Attribute | Type | Read-only | Description |
|---|---|---|---|
| name | string | The attribute name. | |
| value | string | The attribute value. Note, this is always send as a string, but the attribute type dictates the acceptable string formats. eg integer attributes values must be a whole number date attribute values must be a date is ISO format real attribute values must be a decimal string (with period as the decimal separator)checkbox values must be a boolan value ("true", or "false"). |
Attributes of each element in the serials.stockAttrs array.
| Attribute | Type | Read-only | Description |
|---|---|---|---|
| name | string | The attribute name. | |
| value | string | The attribute value. Note, this is always send as a string, but the attribute type dictates the acceptable string formats. eg integer attributes values must be a whole number date attribute values must be a date is ISO format real attribute values must be a decimal string (with period as the decimal separator)checkbox values must be a boolan value ("true", or "false"). |
Path: api/v1/pos/10/stock Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response. This is a list. To keep the example readable, only the first item below is written out; the later items have been trimmed down in this documentation. In a real response each item comes back with the data applicable to that record (as described above). Side-loading related resources with the include query parameter is not supported on list endpoints: an include parameter is ignored here and no included section is returned. To retrieve a related resource, request it directly using the id shown in each item's relationships, or use the single-resource (get by id) endpoint, which does support include.
Example GET (Return all)
{
"data": [
{
"id": "10-1",
"type": "PurchaseStock",
"attributes": {
"qty": 2.0,
"qtyReceived": 2.0,
"unitPrice": 20.0,
"unitPriceTF": 20.0,
"unitPriceTP": 20.0,
"configNo": 4501,
"serials": [
{
"serialNo": "serial1",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
]
},
{
"serialNo": "serial2",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
]
}
],
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
],
"addinit": "API",
"adddate": "2025-03-27T12:39:00",
"stockId": 3,
"stockCode": "SAMSUNG.MON.CONNECT",
"unit": "EACH",
"description": "Samsung Monitor Connector.",
"modifyinit": "API",
"modifydate": "2025-03-27T12:39:00"
}
},
{
"id": "10-2",
"type": "PurchaseStock",
"attributes": {
"stockCode": "MOUSE",
"qty": 1.0
}
},
{
"id": "10-3",
"type": "PurchaseStock",
"attributes": {
"stockCode": "MOUSE2",
"qty": 1.0
}
}
]
}
Path: api/v1/pos/10/stock/10-1 Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example GET (Return specific)
{
"data": {
"id": "10-1",
"type": "PurchaseStock",
"attributes": {
"qty": 2.0,
"qtyReceived": 2.0,
"unitPrice": 20.0,
"unitPriceTF": 20.0,
"unitPriceTP": 20.0,
"configNo": 4501,
"serials": [
{
"serialNo": "serial1",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
]
},
{
"serialNo": "serial2",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
]
}
],
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
],
"addinit": "API",
"adddate": "2025-03-27T12:39:00",
"stockId": 3,
"stockCode": "SAMSUNG.MON.CONNECT",
"unit": "EACH",
"description": "Samsung Monitor Connector.",
"modifyinit": "API",
"modifydate": "2025-03-27T12:39:00"
},
"links": {
"self": "/api/v1/pos/10/stock/10-1"
}
}
}
Path: api/v1/pos/10/stock Request: Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example POST
{
"data": {
"type": "PurchaseStock",
"attributes": {
"stockCode": "SAMSUNG.MON.CONNECT",
"stockId": 4050,
"qty": 3.0,
"qtyReceived": 1.0,
"unitPriceTF": 10.0,
"description": "Samsung Monitor Connector. New",
"serials": [
{
"serialNo": "serial1",
"stockAttrs": [
{ "name": "Colour", "value": "R,Red" }
]
},
{
"serialNo": "serial2"
}
],
"stockAttrs": [
{ "name": "Size", "value": "8,Eight" }
]
}
}
}
{
"data": {
"id": "10-5",
"type": "PurchaseStock",
"attributes": {
"qty": 3.0,
"qtyReceived": 1.0,
"unitPrice": 10.0,
"unitPriceTF": 10.0,
"unitPriceTP": 10.0,
"configNo": 4501,
"serials": [
{
"serialNo": "serial1",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
]
},
{
"serialNo": "serial2",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
]
},
{
"serialNo": "serial3",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
]
}
],
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
],
"addinit": "API",
"adddate": "2025-03-27T13:15:09.3523149+11:00",
"stockId": 3,
"stockCode": "SAMSUNG.MON.CONNECT",
"unit": "EACH",
"description": "Samsung Monitor Connector. New",
"modifyinit": "API",
"modifydate": "2025-03-27T13:15:09.3523149+11:00"
},
"links": {
"self": "/api/v1/pos/10/stock/10-5"
}
}
}
Path: api/v1/pos/10/stock/10-1 Request: Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example PATCH
{
"data": {
"id": "10-1",
"type": "PurchaseStock",
"attributes": {
"qty": 5.0,
"qtyReceived": 3.0,
"unitPriceTF": 30.0,
"description": "Samsung Monitor Connector. Extra",
"serials": [
{
"serialNo": "serial1",
"stockAttrs": [
{ "name": "Colour", "value": "R,Red" }
]
}
],
"stockAttrs": [
{ "name": "Size", "value": "8,Eight" }
]
}
}
}
{
"data": {
"id": "10-1",
"type": "PurchaseStock",
"attributes": {
"qty": 5.0,
"qtyReceived": 3.0,
"unitPrice": 30.0,
"unitPriceTF": 30.0,
"unitPriceTP": 30.0,
"configNo": 4501,
"serials": [
{
"serialNo": "serial1",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
]
},
{
"serialNo": "serial2",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
]
}
],
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "8,Eight"
}
],
"addinit": "API",
"adddate": "2025-03-27T12:39:00",
"stockId": 3,
"stockCode": "SAMSUNG.MON.CONNECT",
"unit": "EACH",
"description": "Samsung Monitor Connector. Extra",
"modifyinit": "API",
"modifydate": "2025-03-27T12:39:00"
},
"links": {
"self": "/api/v1/pos/10/stock/10-1"
}
}
}